test(e2e): Port the nestjs-bullmq E2E app to span streaming - #24107
Open
chargome wants to merge 1 commit into
Open
test(e2e): Port the nestjs-bullmq E2E app to span streaming#24107chargome wants to merge 1 commit into
chargome wants to merge 1 commit into
Conversation
Removes the `traceLifecycle: 'static'` pin and rewrites the specs against streamed spans. The queue span is named `process test-queue` under span streaming, the other way around from the transaction name. Streamed spans carry no breadcrumbs, so `/check-isolation` reports which of the processor's breadcrumbs leaked into its isolation scope as a span attribute. Ref: #23801 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Member
Author
|
bugbot run |
Contributor
size-limit report 📦
|
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 829a5a0. Configure here.
chargome
marked this pull request as ready for review
September 7, 2026 12:25
|
|
||
| await fetch(`${baseURL}/check-isolation`); | ||
|
|
||
| return (await segmentSpanPromise).attributes['isolation_scope.leaked_breadcrumbs']?.value; |
Contributor
There was a problem hiding this comment.
Bug: The test can crash with a TypeError if the isolation_scope.leaked_breadcrumbs attribute is undefined, as .toContain() cannot be called on it.
Severity: LOW
Suggested Fix
Before the assertion, ensure the isolation_scope.leaked_breadcrumbs attribute is an array. You can default the value to an empty array if it's undefined to prevent the crash, for example: expect(breadcrumbs ?? []).not.toContain(...).
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location:
dev-packages/e2e-tests/test-applications/nestjs-bullmq/tests/bullmq.test.ts#L21
Potential issue: The e2e test for `/check-isolation` is fragile and can crash. If
`getActiveSpan()` returns `null` during the request, the
`isolation_scope.leaked_breadcrumbs` attribute is not set on the span. The test code
then accesses this attribute, which evaluates to `undefined`. The subsequent assertion,
`expect(undefined).not.toContain(...)`, throws a `TypeError` because the matcher expects
a string or an array. This causes the test runner to crash instead of reporting a clear
assertion failure.
Did we get this right? 👍 / 👎 to inform future reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes the
traceLifecycle: 'static'pin and rewrites the specs against streamed spans.The queue span is named
process test-queueunder span streaming, the other way around from the transaction name. Streamed spans carry no breadcrumbs, so/check-isolationreports which of the processor's breadcrumbs leaked into its isolation scope as a span attribute.Ref: #23801
🤖 Generated with Claude Code